package com.simon.resourcestatistics.controller;

import javax.annotation.Resource;

import com.simon.resourcestatistics.model.Users;
import com.simon.resourcestatistics.service.IUsersService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * UsersController
 */
@ApiOperation("登录")
@RestController
@RequestMapping("/users")
public class UsersController {

    @Resource
    private IUsersService usersService;

    @ApiOperation(value = "登录",notes="根据卡号和电话登录")
    @ApiImplicitParams({
        @ApiImplicitParam(name="name",value="姓名",required = true,paramType = "path"),
        @ApiImplicitParam(name="pwd",value="密码",required = true,paramType = "path")
     })
    @GetMapping(value="/{name},/{pwd}")
    public Users login(@PathVariable String name,@PathVariable String pwd){
        return usersService.login(name, pwd);
    }

}